<template<template>
  <!-- 添加或编辑对话框 -->
  <el-dialog class="xiaobu-form-dialog" v-bind="$attrs" v-on="$listeners">
    <div class="el-dialog-body-child">
      <el-form
        class="clearfix"
        ref="dialogFormRef"
        :model="dialogForm"
        :disabled="true"
        label-width="136px"
      >
        <el-form-item class="half" label="操作员用户ID" prop="operateBy">
          <el-input
            v-model="dialogForm.operateBy"
            clearable
          />
        </el-form-item>
        <el-form-item class="half" label="操作IP地址" prop="operateIp">
          <el-input
            v-model="dialogForm.operateIp"
            clearable
          />
        </el-form-item>
        <el-form-item class="half" label="接口请求地址" prop="apiUrl">
          <el-input
            v-model="dialogForm.apiUrl"
            clearable
          />
        </el-form-item>
        <el-form-item class="half" label="请求方式" prop="requestMethod">
          <el-input
            v-model="dialogForm.requestMethod"
            clearable
          />
        </el-form-item>
        <el-form-item class="half" label="接口请求状态" prop="status">
          <el-select-dict
            dictType="LOGIN_STATUS"
            v-model="dialogForm.status"
            clearable
          />
        </el-form-item>
        <el-form-item class="half" label="接口提示信息" prop="operateMsg">
          <el-input
            v-model="dialogForm.operateMsg"
            clearable
          />
        </el-form-item>
        <el-form-item class="half" label="操作日期" prop="operateTime">
          <el-date-picker
            v-model="dialogForm.operateTime"
            type="datetime"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item class="half" label="接口响应时长(ms)" prop="responseTime">
          <el-input
            v-model="dialogForm.responseTime"
            clearable
          />
        </el-form-item>
        <el-form-item class="half" label="操作地址(国家)" prop="operateLocationCountry">
          <el-input
            v-model="dialogForm.operateLocationCountry"
            clearable
          />
        </el-form-item>
        <el-form-item class="half" label="操作地址(城市)" prop="operateLocationCity">
          <el-input
            v-model="dialogForm.operateLocationCity"
            clearable
          />
        </el-form-item>
        <el-form-item class="half" label="操作地址(区域)" prop="operateLocationRegion">
          <el-input
            v-model="dialogForm.operateLocationRegion"
            clearable
          />
        </el-form-item>
        <el-form-item class="half" label="操作地址(经度)" prop="operateLocationLatitude">
          <el-input
            v-model="dialogForm.operateLocationLatitude"
            clearable
          />
        </el-form-item>
        <el-form-item class="half" label="操作地址(纬度)" prop="operateLocationLongitude">
          <el-input
            v-model="dialogForm.operateLocationLongitude"
            clearable
          />
        </el-form-item>
        <el-form-item class="all" label="操作设备信息" prop="browser">
          <el-input
            type="textarea"
            :autosize="{ minRows: 2, maxRows: 6 }"
            v-model="dialogForm.browser"
            clearable
          />
        </el-form-item>
        <el-form-item class="all" label="请求入参(query)" prop="queryJson">
          <el-input
            type="textarea"
            :autosize="{ minRows: 2, maxRows: 6 }"
            v-model="dialogForm.queryJson"
            clearable
          />
        </el-form-item>
        <el-form-item class="all" label="请求入参(body)" prop="bodyJson">
          <el-input
            type="textarea"
            :autosize="{ minRows: 2, maxRows: 6 }"
            v-model="dialogForm.bodyJson"
            clearable
          />
        </el-form-item>
      </el-form>
    </div>
    <div slot="footer" class="dialog-footer">
      <template>
        <el-button @click="$emit('close')">关 闭</el-button>
      </template>
    </div>
  </el-dialog>
</template>
<script>
export default {
  name: "OperateLogDialog",
  props: {
    // 配置数据
    baseForm: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  data() {
    return {
      dialogForm: {
        operateBy: "", // 操作员用户id
        operateIp: "", // 操作IP地址
        apiUrl: "", // 接口请求地址
        requestMethod: "", // 请求方式
        status: "", // 请求状态
        operateMsg: "", // 请求提示语
        operateTime: "", // 操作时间
        responseTime: "", // 接口响应时间
        operateLocationCountry: "", // 操作地址(国家)
        operateLocationCity: "", // 操作地址(城市)
        operateLocationRegion: "", // 操作地址(区域)
        operateLocationLatitude: "", // 操作地址(经度)
        operateLocationLongitude: "", // 操作地址(纬度)
        browser: "", // 操作设备信息
        queryJson: "", // 请求入参
        bodyJson: "" // 请求入参
      }, // 弹框表单
    }
  },
  watch: {
    // 监听baseForm变化 拷贝baseForm
    baseForm: {
      handler: function(val) {
        this.dialogForm = JSON.parse(JSON.stringify(val))
      },
      immediate: true,
      deep: true
    }
  },
  methods: {
  }
}
</script>
